<!DOCTYPE html >
<html lang="en" class="one_huder">
<head>
    <meta charset="UTF-8">
    <title>公章卫士管理平台</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <title>登录</title>
    <link rel="stylesheet" href="/asset/layui/css/layui.css">
    <link rel="stylesheet" href="/asset/css/index.css?v=80901008">
    <script type="text/javascript" src="/asset/js/jquery-3.3.1.min.js"></script>
    <script src="/asset/layui/layui.js" charset="utf-8"></script>
</head>
<body class="layui-layout-body">
<div class="layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo"><img src="asset/images/logon.png" alt=""></div>
    </div>
    <div class="login_box">
        <div class="flesx">
            
            <form method="post" class="layui-form">
                <div class="login_form" id="step1">
                    <h4 class="login_title">找回密码</h4>
                    <input type="text" name="mobile" value=""  placeholder="请输入手机号码" class="input_top adminbox">
                    <div class="posireletave">
                    	<input type="text" name="checkCode" autocomplete="off" class="input_top imgbox" placeholder="图形验证码"> 
                    	<img src="/kaptcha.htm" onclick="this.src='/kaptcha.htm?r='+Math.random()" alt="" class="tephone_img">
                    </div>
                    <input type="submit" lay-submit lay-filter="nextstep" value="下一步" class="button_box">
                    <div class="back_pwd">想起密码？<a href="/login.htm">立即登陆</a></div>
                </div>
                
                <div class="login_form layui-hide" id="step2">
                    <h4 class="login_title">找回密码</h4>
                    <div class="back_pwd_mobile">手机号码：<span id="mobile">***********</span></div>
                    
                    <div class="input_buttonbox">
                        <input type="text" name="authCode" placeholder="请输入短信验证码" class="fl">
                        <input type="submit" lay-submit lay-filter="sendsms" value="获取验证码" class="fr code_btn">
                    </div>
                    <input type="password" name="newPassword" value=""   placeholder="请输入新密码" class="input_top">
                    <input type="password" name="confirmPassword" value=""   placeholder="请输入确认密码" class="input_top">
                    <input type="submit" lay-submit lay-filter="changeSubmit" value="确认提交" class="button_box">
                    <div class="back_pwd">想起密码？<a href="/login.htm">立即登陆</a></div>
                </div>
                
            </form>
            
            
        </div>
        <div class="layui-carousel" id="test10">
            <div carousel-item="">
                <div>
                    <div class="imges" style="background:url(asset/images/login_bg1.jpg)no-repeat center top ;"></div>
                </div>
                <div>
                    <div class="imges" style="background:url(asset/images/login_bg1.jpg) no-repeat center top ;"></div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="footer">
    <p>服务热线：021-09875564</p>
    <p>版权所有 © 2018-2028 公章卫士 沪ICP备11057864-1号</p>
</div>
<script>


       var regist={
			countdown: 60,
			startTime: function() {
				if (regist.countdown <= 0) {
					regist.sendButt.removeAttr('disabled').css('background','#e9221f');
					regist.sendButt.val("重新发送");
					regist.countdown = 60;
				} else {
					regist.sendButt.attr('disabled','true').css('background','#d2d2d2');
					regist.sendButt.val(regist.countdown + "秒");
					regist.countdown--;
					setTimeout(function() {
						regist.startTime()
					}, 1000)
				}
			}
		}


    layui.use(['carousel', 'form'], function () {
        var carousel = layui.carousel;
        var form = layui.form;
        
        //监听提交
        form.on('submit(nextstep)', function (data) {

            $.ajax({
                type: "POST",
                url: "/forgetPwd/check.htm",
                data: data.field,
                success: function (result) {
					console.log(result)
                    if (result.code == '1') {
                        
                        $("#step1").addClass("layui-hide");
                        $("#step2").removeClass("layui-hide");
                        $("#mobile").html(result.data);
                        
                    } else {
                        layer.msg(result.msg);
                    }

                }
            });
            

            return false;
        });
        form.on('submit(sendsms)', function (data) {
			regist.sendButt=$(this);
        	$.ajax({
      			type:"POST", 
      			url:"/forgetPwd/sendsms.htm",
      			data:data.field,
      			success:function(result) {
		      		if(result.code=='1'){
      					regist.startTime();
		      			layer.msg("验证码发送成功，请注意查收");
		      		}else{
		      		 	layer.msg(result.msg);
		      		}
		      
		    	 } 
		    });
            return false;
        });
        
        
        form.on('submit(sendsms)', function (data) {
			regist.sendButt=$(this);
        	$.ajax({
      			type:"POST", 
      			url:"/forgetPwd/sendsms.htm",
      			data:data.field,
      			success:function(result) {
		      		if(result.code=='1'){
      					regist.startTime();
		      			layer.msg("验证码发送成功，请注意查收");
		      		}else{
		      		 	layer.msg(result.msg);
		      		}
		      
		    	 } 
		    });
            return false;
        });
        
        form.on('submit(changeSubmit)', function (data) {
        	$.ajax({
      			type:"POST", 
      			url:"/forgetPwd/change.htm",
      			data:data.field,
      			success:function(result) {
		      		if(result.code=='1'){
		      			layer.confirm('密码修改成功，立即前往登陆', {
						  btn: ['确认'] //按钮
						}, function(){
						  location.href="/login.htm";
						});
		      		}else{
		      		 	layer.msg(result.msg);
		      		}
		      
		    	 } 
		    });
            return false;
        });
        
        
        carousel.render({
            elem: '#test10',
            width: '100%',
            height: '536px',
            interval: 5000,
            indicator: 'none'
        });
      
    });
</script>
</body>
</html>